<% // Copyright 2008 Carnegie Mellon University
// Licensed under the Apache License, Version 2.0 (the "License"); 
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//  
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, 
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License. %>

<%@page import="java.sql.*"%>
<%@page import="edu.cmu.lti.sepia.data.session.SessionManager"%>
<%@page import="edu.cmu.lti.sepia.data.resource.ResourceManager"%>
<%@page import="edu.cmu.lti.sepia.data.db.SQL"%>
<%@page import="edu.cmu.lti.sepia.task.update.Updater"%>
<%@page import="edu.cmu.lti.sepia.util.*"%>

<%@page language="java" contentType="text/html; charset=UTF-8" %>
<%@page pageEncoding="UTF-8" %> 

<%
 response.setHeader("progma", "no-cache");
 response.setHeader("Cache-Control", "no-cache");
 request.setCharacterEncoding("UTF8");
 ResourceManager.applicationInit(application);
 
 //TODO: remove hardcode
 //we need dummy ones too for the resource.js.jsp
 session.setAttribute("language", "EN");
 session.setAttribute("userName", "");
 session.setAttribute("userId", -1);
 session.setAttribute("taskName", "");
 session.setAttribute("taskNameShort", "");
 session.setAttribute("isMonolingual", false);
 session.setAttribute("types", new String[0]);
 session.setAttribute("host", request.getRemoteHost());
 %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SEPIA Update</title>
</head>
<body>

<h1>Welcome to SEPIA update wizard.</h1>
<%
SQL sql = new SQL();
out.println(Updater.doUpdates(sql));
sql.close();
%>
<br>
<br>
See the <a href="https://mu.lti.cs.cmu.edu/trac/sepia/wiki/EN/VersionHistory" target="_blank">version history</a>
 for the changes in the latest releases.<br>

</body>
</html>